﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace RxCloud
{
    internal static class Utils
    {
        internal static System.ServiceModel.Channels.Binding GetBinding(string p)
        {
            switch (p)
            {
                case "tcp":
                    return new NetTcpBinding(SecurityMode.None);
                case "http":
                    return new BasicHttpBinding(BasicHttpSecurityMode.None);
                default:
                    throw new InvalidOperationException("Unknown protocol");
            }
        }

        internal static string GetScheme(string p)
        {
            switch (p)
            {
                case "tcp":
                    return "net.tcp";
                case "http":
                    return "http";
                default:
                    throw new InvalidOperationException("Unknown protocol");
            }
        }
    }
}
